<?php
class SessionUser extends BaseData {
	
	// the current user
	private $user; 
	
	// readonly says whether the currently logged user 
	// shall have read write access or view only
	private $readonly; 
	
	public function SessionUser(){
		parent::BaseData();
	}
	
	public function isLogged(){
		return ($this->getUser() != null);
	}
	
	public function isAdmin(){
		return $this->isLogged() && $this->getUser()->isAdmin();
	}
	
	public function setUser($val){ $this->user = $val; }
	public function getUser(){ return $this->user; }
	
	public function setReadonly($val){  $this->readonly = $val; }
	public function isReadonly(){ return $this->readonly; }
	
} 
?>